<template>
    <div class="flex flex-col">
        <div class="w-full ">
            <div style="height:50px">
                <Xheader></Xheader>
            </div>
            <div class="flex flex-1">
                <div style="background:#131824;">
                    <Xmenus :fold="fold"></Xmenus>
                </div>
                <div class="flex-1 flex-col">
                    <div class="flex-none">
                        <div style="height:50px;">
                            <hd-history
                                @updatefold="update"></hd-history>

                        </div>

                    </div>
                    <div class="flex-grow-0">
                        <el-main>
                            <router-view/>
                        </el-main>
                    </div>
                    <div class="">
                        <el-divider></el-divider>
                        <div class="text-center text-gray-600 text-sm text-md font-sans italic ">
                            卡券管理系统 {{ date }}
                        </div>
                    </div>
                </div>
            </div>
            <el-backtop :bottom="50">
            </el-backtop>
        </div>
    </div>
</template>

<script>
import Xheader from './components/header.vue'
import Xmenus from './components/menus.vue'

export default {
    route: {meta: {auth: true}},
    components: {Xheader, Xmenus},
    data() {
        return {
            date: '',
            fold: false
        }
    },
    created() {
        this.date = new Date().getFullYear()
        //获取当前用户权限，放到layout的目的是只在layout下调用一次，然后混入到原型里面
        this.$hd.init()
    },
    methods: {
        update(toggle) {
            this.fold = toggle
        }
    }

}
</script>

<style scoped>

</style>
